<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="model.Resources"%>
 <%@page import="java.util.*,model.*,util.*,control.*"%> 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>resources_update.jsp</title>
</head>
<script language="javascript"> 
		function check()
		{
			    if(document.form1.resources_name.value=="")
				{
					alert("资源名称不能为空");
					document.form1.resources_name.focus();
					return;
				}
				else if(document.form1.resources_type.value=="")
				{
					alert("资源类型不能为空");
					document.form1.resources_type.focus();
					return;
				}
				else if(document.form1.resources_introduction.value=="")
				{
					alert("介绍不能为空");
					document.form1.resources_introduction.focus();
					return;
				}else
				{form1.submit();}
		} 
		</script>
<body>
<%
      request.setCharacterEncoding("UTF-8");
      int id=ParamUtil.getInt(request,"id",0);
      Resources resources = new Resources();
      ResourcesControl rc = new ResourcesControl();
	  resources = rc.getResourcesInformation(id);
  %>
  <form action="resources_update_chuli.jsp?id=<%=id%>" name="form1" method="post">
  	<table>
				<tr>
					<td>
						资源名称（必填）：
						<input type="text" name="resources_name" id="resources_name" value="<%=resources.getName()%>"/>
					</td>
				</tr>
				<tr>
					<td>
						资源类型（必填）：
						<input type="text" name="resources_type" id="resources_type" value="<%=resources.getType()%>" />
					</td>				
				</tr>
	            <tr>
					<td>
						路径：
						<input type="text" name="resources_path" id="resources_path" value="<%=resources.getPath()%>" />
					</td>
				</tr>
				<tr>
					<td>
						介绍（必填）：
						<input type="text" name="resources_introduction" id="resources_introduction" value="<%=resources.getIntroduction()%>" />
					</td>
				</tr>
				<tr>
					<td>
						是否推荐：
						<input type="radio" name="resources_isrecommend" id="resources_isrecommend" value="1" checked/>
						是
						<input name="resources_isrecommend" type="radio" id="resources_isrecommend" value="0"/>
						否
					</td>
				</tr>
		</table>
	    <input type="button" name="button2" value="提交" onClick="check()" />
		<input type="reset" name="Reset" value="重置" />
 </form>
</body>
</html>